using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Attributes.DomainAttributes;
using Baci.Net.ToolKit.ArcGISProGeoprocessor.Models.Enums;
using System.Collections.Generic;
using System.ComponentModel;

namespace Baci.ArcGIS._DataManagementTools._Fields
{
    /// <summary>
    /// <para>Transpose Fields</para>
    /// <para>Switch  data stored in fields or columns to rows in a new table or feature class.</para>
    /// <para>将存储在字段或列中的数据切换到新表或要素类中的行。</para>
    /// </summary>    
    [DisplayName("Transpose Fields")]
    public class TransposeFields : AbstractGPProcess
    {
        /// <summary>
        /// 无参构造
        /// </summary>
        public TransposeFields()
        {

        }

        /// <summary>
        /// 有参构造
        /// </summary>
        /// <param name="_in_table">
        /// <para>Input Table</para>
        /// <para>The input feature class or table containing data value fields to be transposed.</para>
        /// <para>包含要转置的数据值字段的输入要素类或表。</para>
        /// </param>
        /// <param name="_in_field">
        /// <para>Fields To Transpose</para>
        /// <para><xdoc>
        ///   <para>The fields or columns containing data values in the input table that need to be transposed.</para>
        ///   <para>Depending on your needs, you can select multiple fields to be transposed. The value here defines what the field name will be in the output. When not specified, the value is the same as the field name by default. However, you can also specify your own value. For example, if the field names to be transposed are Pop1991, Pop1992, and so on, by default, the values for these fields in the output will be the same (Pop1991, Pop1992, and so forth). However, you can choose to specify your own values such as 1991 and 1992.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入表中包含需要转置的数据值的字段或列。</para>
        ///   <para>根据您的需要，您可以选择要转置的多个字段。此处的值定义输出中的字段名称。如果未指定，则默认情况下该值与字段名称相同。但是，您也可以指定自己的值。例如，如果要转置的字段名称为 Pop1991、Pop1992 等，则默认情况下，输出中这些字段的值将相同（Pop1991、Pop1992 等）。但是，您可以选择指定自己的值，例如 1991 和 1992。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_out_table">
        /// <para>Output Table</para>
        /// <para><xdoc>
        ///   <para>The output feature class or table. The output will contain a transposed field, a value field, and any number of specified attribute fields that need to be inherited from the input table.</para>
        ///   <para>By default the Output Table is a table. The output will be a feature class when the Input Table is a feature class and the Shape field is selected in the Attribute Fields parameter.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出要素类或表。输出将包含一个转置字段、一个值字段以及需要从输入表继承的任意数量的指定属性字段。</para>
        ///   <para>默认情况下，输出表是一个表。当输入表为要素类，并且在属性字段参数中选择了形状字段时，输出将为要素类。</para>
        /// </xdoc></para>
        /// </param>
        /// <param name="_in_transposed_field_name">
        /// <para>Transposed Field</para>
        /// <para>The name of the field that will be created to store field names of the transposed fields. Any valid field name can be used.</para>
        /// <para>将创建的字段的名称，用于存储转置字段的字段名称。可以使用任何有效的字段名称。</para>
        /// </param>
        /// <param name="_in_value_field_name">
        /// <para>Value Field</para>
        /// <para>The name of the field that will be created to store the corresponding values of the transposed fields. Any valid field name can be set, as long as it does not conflict with existing field names from the input table or feature class.</para>
        /// <para>将创建的字段的名称，用于存储转置字段的相应值。可以设置任何有效的字段名称，只要它不与输入表或要素类中的现有字段名称冲突即可。</para>
        /// </param>
        public TransposeFields(object _in_table, object _in_field, object _out_table, object _in_transposed_field_name, object _in_value_field_name)
        {
            this._in_table = _in_table;
            this._in_field = _in_field;
            this._out_table = _out_table;
            this._in_transposed_field_name = _in_transposed_field_name;
            this._in_value_field_name = _in_value_field_name;
        }
        public override string ToolboxName => "Data Management Tools";

        public override string ToolName => "Transpose Fields";

        public override string CallName => "management.TransposeFields";

        public override List<string> AcceptEnvironments => ["workspace"];

        public override object[] ParameterInfo => [_in_table, _in_field, _out_table, _in_transposed_field_name, _in_value_field_name, _attribute_fields];

        /// <summary>
        /// <para>Input Table</para>
        /// <para>The input feature class or table containing data value fields to be transposed.</para>
        /// <para>包含要转置的数据值字段的输入要素类或表。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Input Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_table { get; set; }


        /// <summary>
        /// <para>Fields To Transpose</para>
        /// <para><xdoc>
        ///   <para>The fields or columns containing data values in the input table that need to be transposed.</para>
        ///   <para>Depending on your needs, you can select multiple fields to be transposed. The value here defines what the field name will be in the output. When not specified, the value is the same as the field name by default. However, you can also specify your own value. For example, if the field names to be transposed are Pop1991, Pop1992, and so on, by default, the values for these fields in the output will be the same (Pop1991, Pop1992, and so forth). However, you can choose to specify your own values such as 1991 and 1992.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输入表中包含需要转置的数据值的字段或列。</para>
        ///   <para>根据您的需要，您可以选择要转置的多个字段。此处的值定义输出中的字段名称。如果未指定，则默认情况下该值与字段名称相同。但是，您也可以指定自己的值。例如，如果要转置的字段名称为 Pop1991、Pop1992 等，则默认情况下，输出中这些字段的值将相同（Pop1991、Pop1992 等）。但是，您可以选择指定自己的值，例如 1991 和 1992。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Fields To Transpose")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_field { get; set; }


        /// <summary>
        /// <para>Output Table</para>
        /// <para><xdoc>
        ///   <para>The output feature class or table. The output will contain a transposed field, a value field, and any number of specified attribute fields that need to be inherited from the input table.</para>
        ///   <para>By default the Output Table is a table. The output will be a feature class when the Input Table is a feature class and the Shape field is selected in the Attribute Fields parameter.</para>
        /// </xdoc></para>
        /// <para><xdoc>
        ///   <para>输出要素类或表。输出将包含一个转置字段、一个值字段以及需要从输入表继承的任意数量的指定属性字段。</para>
        ///   <para>默认情况下，输出表是一个表。当输入表为要素类，并且在属性字段参数中选择了形状字段时，输出将为要素类。</para>
        /// </xdoc></para>
        /// <para></para>
        /// </summary>
        [DisplayName("Output Table")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _out_table { get; set; }


        /// <summary>
        /// <para>Transposed Field</para>
        /// <para>The name of the field that will be created to store field names of the transposed fields. Any valid field name can be used.</para>
        /// <para>将创建的字段的名称，用于存储转置字段的字段名称。可以使用任何有效的字段名称。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Transposed Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_transposed_field_name { get; set; }


        /// <summary>
        /// <para>Value Field</para>
        /// <para>The name of the field that will be created to store the corresponding values of the transposed fields. Any valid field name can be set, as long as it does not conflict with existing field names from the input table or feature class.</para>
        /// <para>将创建的字段的名称，用于存储转置字段的相应值。可以设置任何有效的字段名称，只要它不与输入表或要素类中的现有字段名称冲突即可。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Value Field")]
        [Description("")]
        [Option(OptionTypeEnum.Must)]
        public object _in_value_field_name { get; set; }


        /// <summary>
        /// <para>Attribute Fields</para>
        /// <para>Additional attribute fields from the input table to be included in the output table. If you want to output a feature class, add the Shape field.</para>
        /// <para>输入表中要包含在输出表中的其他属性字段。如果要输出要素类，请添加形状字段。</para>
        /// <para></para>
        /// </summary>
        [DisplayName("Attribute Fields")]
        [Description("")]
        [Option(OptionTypeEnum.optional)]
        public List<object> _attribute_fields { get; set; } = null;


        public TransposeFields SetEnv(object workspace = null)
        {
            base.SetEnv(workspace: workspace);
            return this;
        }

    }

}